<?php

class IndexController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    	//$this->_helper->layout()->setLayout("main");
        //设置首页引用js
        $this->view->headScript()->appendFile($this->view->baseUrl().'/js/index_flash.js');
        //设置首页引用css
        $this->view->headLink()->appendStylesheet($this->view->baseUrl().'/css/index.css');
    }

    public function indexAction()
    {
		//设置title
		$this->view->headTitle("翡翠饰品 - 和田玉饰品 - 岫玉工艺品 - 玉石类礼品展示及介绍");
		//设置关键词（seo）
		$this->view->headMeta()->appendName('keywords', '翡翠饰品,岫玉工艺品,和田玉饰品,玉石商品,玉石礼品,玉石文化,翡翠知识,和田玉知识,岫玉知识');
		//设置描述（seo）
		$this->view->headMeta()->appendName('description','淘岫玉网站主要介绍各类玉石文化及行业新闻，分享翡翠知识、和田玉知识、岫玉知识。展示翡翠饰品、岫玉工艺品、和田玉饰品、各类玉石商品及玉石礼品');
        $articleModel=new Application_Model_DbTable_Article();
        $this->view->longTitleArticle=$articleModel->getNewestLongTitleArticle();
        $this->view->shortTitleArticle=$articleModel->getNewestShortTitleArticle(16);
        /*$this->view->articleNewsList=$articleModel->getIndexArticleList(0);
        $this->view->articleDigestList=$articleModel->getIndexArticleList(1);
        $this->view->articleKnowledgeList=$articleModel->getIndexArticleList(2);*/
        $db_taobaoitems=new Application_Model_DbTable_TaobaoItems();
        $this->view->newItemsList=$db_taobaoitems->getNewItems();
        $this->view->promotionItemsList=$db_taobaoitems->getPromotionItems();
        $db_items_join_character=new Application_Model_DbTable_ItemsJoinCharacter();
        $this->view->hotItemsList=$db_items_join_character->getXiuItems(0,12);
        //设置专题
        $config=new Zend_Config_Ini(APPLICATION_PATH."/configs/application.ini",'production');
        $db = Zend_Db::factory($config->resources->db);
		$selecter=$db->select()->from('txy_zhuanti')->where('id in (1,2,3,4)')->order('id desc')->limit(4);
		$zhuanTiList=$db->fetchAll($selecter);
		$zhuanTiUtil=new Txy_Util_ZhuanTi();
		foreach ($zhuanTiList as &$zhuanTi){
			$zhuanTiUtil->getZhuanTiDetail($zhuanTi, $db,6);
		}
        $this->view->zhuanTiList=$zhuanTiList;
        
    }

    public function testAction()
    {
        // action body
                //$this->_helper->layout()->setLayout("main");
                
            	
               // $this->_helper->layout()->disableLayout();
         define( "WB_AKEY" , '3680513417' );
         echo  WB_AKEY;  
         define( "WB_AKEY" , '2222222222' );
         echo  WB_AKEY;    
    }

    public function ajaxStatusAction()
    {
        // action body
    }


}





